<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta itemprop="name" content="GTI" />
  <meta itemprop="image" content="http://www.gtigroup.org/app/html/img/icon.png" />
  <meta name="description" itemprop="description" content="Please choose the right version to start downloading." />

  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <link rel="stylesheet" href="bower_components/normalize-css/normalize.css">

  <title>GTI</title>
  <style>
    a:focus,
    input:focus,
    button:focus {
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    
    #app {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      text-align: center;
      background: url('img/background1.jpg');
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
    
    .download {
      margin-top: 80%;
      text-align: center;
    }
    
    .download a {
      border: 1px solid white;
      border-radius: 100px;
      padding: 15px 0;
      background-color: transparent;
      width: 34%;
      display: block;
      color: white;
      margin: 25px auto;
      text-decoration: none;
    }
    
    .download a:active {
      color: lightgray;
      border: 1px solid lightgray;
    }
    
    .weixin-tip {
      display: none;
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.8);
      filter: alpha(opacity=80);
      height: 100%;
      width: 100%;
      z-index: 100;
    }
    
    .weixin-tip p {
      text-align: center;
      margin-top: 10%;
      padding: 0 5%;
    }
    
    .weixin-tip img {
      max-width: 100%;
      height: auto;
    }
  </style>
</head>

<body>

  <div id="app">
    <div class="download">
      <!--<a id="aDownload" href="http://mp.weixin.qq.com/mp/redirect?url=http%3a%2f%2fwww.gtigroup.org%2fapp%2fgtig-latest.apk#wechat_redirect">Android</a>-->
      <a id="aDownload" href="javascript:;">Android</a>
      <a id="iDownload" href="javascript:;">ios</a>
    </div>
  </div>

  <div class="weixin-tip">
    <p>
      <img src="img/live_weixin.png" alt="微信打开" />
    </p>
  </div>

  <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script>
    $(function () {
      $('#aDownload').click(function () {
        if (!check_weixin()) {
          location.href = 'http://www.gtigroup.org/app/gtig-latest.apk';
        }
      });
      $('#iDownload').click(function () {
        if (!check_weixin()) {
          location.href = 'https://itunes.apple.com/us/app/gti-workspace/id1178319177?l=zh&ls=1&mt=8#';
        }
      });

      function check_weixin() {
        var winHeight = $(window).height();
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
          $(".weixin-tip").css("height", winHeight);
          $(".weixin-tip").show();
          return true;
        } else {
          return false;
        }
      }

      $('.weixin-tip').click(function(){
        $(".weixin-tip").hide();
      });
      // function is_weixin() {
      //   var ua = navigator.userAgent.toLowerCase();
      //   if (ua.match(/MicroMessenger/i) == "micromessenger") {
      //     return true;
      //   } else {
      //     return false;
      //   }
      // }
      // var isWeixin = is_weixin();
      // if (isWeixin) {
      //   $(".weixin-tip").css("height", winHeight);
      //   $(".weixin-tip").show();
      // }
    });
  </script>
</body>

</html>